<?php 
$conId = 'goodsdetail';
$now_product_id = Yii::$app->request->get ( 'product_id');
?>
<?php $this->beginBlock('css');?>
<link rel="stylesheet" type="text/css" href="<?=Yii::getAlias('@static')?>/pc/liketry/css/goods.css">
<link rel="stylesheet" type="text/css" id="lktStyle">
<?php $this->endBlock();?>
<?php $this->beginBlock('headjs');?>
<script type="text/javascript">
(function(){
	var lktStyle = function(){
		document.getElementById("lktStyle").setAttribute("href", document.documentElement.clientWidth>=1200?"":"<?=Yii::getAlias('@static')?>/pc/liketry/css/small.css")
	}
	window.onresize = lktStyle;
	lktStyle();
})();
</script>
<?php $this->endBlock();?>
<?= $this->render('@liketry/views/layouts/header_goods.php',['top_ad_show'=>false])?>
<!-- 顶部拉幕广告&&搜索框 Start -->
<div class="header"></div>
<!-- 顶部拉幕广告&&搜索框 End -->

<!-- 主体内容 Start -->
<div class="main">
	<div class="products-intro">
		<div class="intro-slider">
			<div class="big-pic"><img src="<?php 
			$img_flag = 0;
			if (empty($goods_info['image']['compress_thumb'])) {
			    echo $goods_info['image']['bigpic'];
			} else {
                echo $goods_info['image']['compress_thumb'];
                $img_flag = 1;
            }
			?>"></div>
			<!--缩图开始-->
			<div class="little-pic"> 
				<a class="prev grey">&lt;</a> 
				<a class="next grey">&gt;</a>
				<ul class="clearfix">
					<?php 
				if(is_array($goods_info['gallery_list'])):
				foreach ($goods_info['gallery_list'] as $imkey=>$imval):?>
                      <li><img src="<?php echo \Yii::$app->params['goods_image_url'] . str_replace('./upload/', 'upload/', $imval['thumb']);?>"></li>
				<?php 
				endforeach;
				endif;?>
				</ul>
			</div>
			<!--缩图结束-->
		</div>

		<div class="intro-text">
			<h1 data-id="<?php echo $goods_info['goods_id']?>"><?php echo $goods_info['goods_name'];?></h1>
			<h2><?php echo $goods_info['goods_desc']?></h2>
			<ul>
				<li class="intxt-price">
				<?php if($goods_info['type'] != 1):?>
					<div class="column column1">
						<div class="intxt-key">价&nbsp;&nbsp;&nbsp;&nbsp; 格：</div>
						<div class="intxt-value"><?php echo $goods_info['sale_price'];?></div>
					</div>
				<?php endif;?>
				<?php if($goods_info['type'] != 2):?>
					<div class="column column2">
						<div class="intxt-key">试 用 价：</div>
						<div class="intxt-value"><?php echo $goods_info['try_price'];?></div>
					</div>
				<?php endif;?>
				<?php if($goods_info['auto_date']>0):?>
					<div class="inxt-time">开放倒计时<em></em></div>
				<?php endif?>
				</li>
				<?php if(!empty($fullcut)):?>
				<li class="intxt-sale">
					<div class="intxt-key">优惠信息：</div>
					<div class="intxt-value"><em class="bg">满减</em> <?php echo $fullcut;?></div>
				</li>
				<?php endif;?>
				<li class="intxt-dashed"></li>
				<li class="intxt-kuang guige">
					<?php echo $sku1;?>
				</li>
				<li class="intxt-kuang guige-child">
					<?php echo $sku2?>
				</li>
				<li class="intxt-num">
					<div class="intxt-key">数    量：</div>
					<div class="intxt-value amount-edit">
						<span class="amount-reduce dis">-</span>
		                <input class="amount-input" type="text" value="1">
		                <span class="amount-add">+</span>
		                
		            </div>
				</li>
			</ul>
			<div class="buy">
			    <?php if($goods_info['type'] != 1):?>
				<a id="salebtn" class="go icon icon-btn1-dis 
				<?php if($now_product_id < 20000000 || $now_product_id > 40000000):?>
				<?php if(empty($goods_info['auto_date']) || $goods_info['auto_date'] < 0): ?>
				<?php if(!empty($goods_info['stype1']) && $goods_info['stype1'] ==1):?>
				<?php if(empty($goods_info['goods_auto_dw']) || $goods_info['goods_auto_dw'] > time()):?>
				    icon-btn1
				<?php endif;?>
				<?php endif;?>
				<?php endif;?>
				<?php endif;?>">
				<?php if(!empty($goods_info['stype1']) && $goods_info['stype1'] ==1):?>
				<?php if(empty($goods_info['goods_auto_dw']) || $goods_info['goods_auto_dw'] > time()):?>
				    购 买
				<?php endif;?>
				<?php endif;?>
				<?php if(empty($goods_info['stype1']) || (!empty($goods_info['goods_auto_dw']) && $goods_info['goods_auto_dw'] < time())):?>
				    已售完
				<?php endif;?></a>
				<?php endif;?>
				<?php if($goods_info['type'] != 2):?>
				<a id="trybtn" title="同件商品限申领一次" class="try icon  icon-btn1-dis 
				<?php if($now_product_id < 20000000 || $now_product_id > 40000000):?>
				<?php if(empty($goods_info['auto_date']) || $goods_info['auto_date'] < 0):?>
				<?php if(!empty($goods_info['stype']) && $goods_info['stype'] ==1):?>
				<?php if(empty($goods_info['goods_auto_dw']) || $goods_info['goods_auto_dw'] > time()): ?>
				    icon-btn1
			    <?php endif;?>
			    <?php endif;?>
			    <?php endif;?>
			    <?php endif;?>">
			    <?php if(!empty($goods_info['stype']) && $goods_info['stype'] ==1):?>
			    <?php if(empty($goods_info['goods_auto_dw']) || $goods_info['goods_auto_dw'] > time()):?>
			                试 用<?php endif;?>
			    <?php endif;?>
			    <?php if(empty($goods_info['stype']) || (!empty($goods_info['goods_auto_dw']) && $goods_info['goods_auto_dw'] < time())):?>
			                已领完
			    <?php endif;?></a>
				<?php endif;?>
			</div>
		</div>
		<div class="clear"></div>
	</div>

	<div class="products-detail">
		<dl class="tab">
			<dt class="cur"><a>商品详情</a></dt>
			<dt><a>商品评论(<em><?php echo !empty($goods_info['reply_back_num'])?$goods_info['reply_back_num']:0;?></em>)</a></dt>
		</dl>
		<dl class="content">
			<dd class="products-description cur">
				<?php echo $goods_info['goods_main']?>
			</dd>
			<dd class="products-review">
				<div class="review">
					<p class="percent">
						<span class="text">好评率</span>
						<span class="bigger"><em>0</em>%</span>
					</p>
					<div>
						<ul>
							<li><span class="title">好评</span><span class="reslute"><em></em></span></li>
							<li><span class="title">中评</span><span class="reslute"><em></em></span></li>
							<li><span class="title">差评</span><span class="reslute"><em></em></span></li>
						</ul>
					</div>
					<p class="awards">发表有效评价即可获得100试豆<br>优质评价加精华后可得300试豆</p>
				</div>
				<div class="rev-select clearfix">
					<label><input name="comment" type="radio" checked value="">全部评价</label>
					<label><input name="comment" type="radio" value="A">好评(<em>0</em>)</label>
					<label><input name="comment" type="radio" value="B">中评(<em>0</em>)</label>
					<label><input name="comment" type="radio" value="C">差评(<em>0</em>)</label>
				</div>
				<ul class="rev-list" id="revList">
					
				</ul>
				<div class="page"></div>
			</dd>
			
		</dl>
		<div class="special">
			<div class="title">特别说明</div>
			<div class="text">
				<p><img src="<?=Yii::getAlias('@static')?>/pc/liketry/images/numer1.png"/ /> 因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件，有试吗不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货！若有试吗没有及时更新，请大家谅解！</p>
				<p><img src="<?=Yii::getAlias('@static')?>/pc/liketry/images/numer2.png" /> 有试吗所有商品均采用专业拍摄，力求将最真实的信息传达至你的视线。但由于个人显示器不同，可能导致实物与图片存在色差，最终颜色请以实物为准。</p>
			</div>
		</div>
	</div>

</div>
<!-- 主体内容 End -->

<!--侧边栏-->
<?= $this->render('@liketry/views/layouts/sidebar.php')?>

<?php $this->beginBlock('js');?>
<script src="<?=Yii::getAlias('@static')?>/pc/common/js/jquery-1.12.3.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/pc/common/js/lkt.pc.js"></script>
<script src="<?= Yii::getAlias('@static')?>/pc/common/js/jquery.lazyload.min.js"></script>
<script src="<?=Yii::getAlias('@static')?>/pc/liketry/js/goodsdetail.js"></script>
<script type="text/javascript">
	var requestReviewUrl = "<?=Yii::$app->urlManager->createUrl(["$conId/getreplymore"]);?>";
	var goodUrl = "<?=Yii::$app->urlManager->createUrl(["$conId/index",'product_id'=>'']);?>";
	var addCarUrl = "<?=Yii::$app->urlManager->createUrl(["cart/add-cart"]);?>"
	var goPayUrl = "<?=Yii::$app->urlManager->createUrl(["cart"]);?>"
	var skuUrl = "<?=Yii::$app->urlManager->createUrl(["$conId/jumping",'goods_id'=>$goods_info['goods_id']]);?>";
	var salesub = <?php echo !empty($goods_info['stype1'])?$goods_info['stype1']:0?>;
	var trysub = <?php echo !empty($goods_info['stype'])?$goods_info['stype']:0?>;
	var tryid = <?php echo !empty($goods_info['try_pid'])?$goods_info['try_pid']:0?>;
	var saleid = <?php echo !empty($goods_info['sale_pid'])?$goods_info['sale_pid']:0?>;
	var autodate = <?php echo !empty($goods_info['auto_date'])?$goods_info['auto_date']:0?>;
    //弹窗登录
	var getLoginUrl = "<?=Yii::$app->urlManager->createUrl(['login/ajax-login']);?>";
	var loginUrl = "<?=Yii::$app->params['domains']['liketry_url']."auth/login_ajax.php";//Yii::$app->urlManager->createUrl(['login/check-login']);?>";
	var codeUrl = "<?=Yii::$app->urlManager->createUrl(['login/verify','rnd'=>time()])?>";
	//图片规则标记变量
	var imgFlag = "<?= $img_flag ?>";
</script>
<?php $this->endBlock();?>
